package com.kevin.demo.springbootdemo2.controller;

import com.kevin.demo.springbootdemo2.po.User;
import com.kevin.demo.springbootdemo2.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author kevin
 * @version： UserController.java v 1.0, 2020年05月20日 17:10
 * @Description
 **/
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/userList")
    public List<User> userList() {
        return userService.queryUsers();
    }

    @DeleteMapping(value = "/deleteUser")
    public boolean deleteUser(@RequestParam("id") int id){
        return userService.deleteUser(id);
    }
}
